<template>
<div class="printer-setting">
    <div class="top">
        <p class="address">
            <img src="./img/icon.png" alt="" />
            <span>炭次郎和风烤肉（中山大道店）</span>
        </p>
        <div class="printing-mode">
            <p class="title">打印方式</p>
            <p class="set">
                <span>打印/自动确认订单</span>
                <img src="./img/r_icon.png" alt="" />
            </p>
        </div>
    </div>
    <div class="content">
        <div class="title">
            已绑定打印机
            <span>2</span>
            台
        </div>
        <ul class="list">
            <li>
                <div class="name">打印机备注名 [ID234123-2323]</div>
                <div class="set-title">打印模板（可多选）</div>
                <div class="checkbox">
                    <van-checkbox-group v-model="result">
                        <van-checkbox name="true">
                            <span>客户联</span>
                            <em>修改</em>
                        </van-checkbox>
                        <div class="set-input">
                            <span>打印联</span>
                            <input type="text" placeholder="" value="1张">
                            <a href="javascript:void(0);">打印预览</a>
                        </div>
                    </van-checkbox-group>
                </div>
            </li>
        </ul>
    </div>
    <div class="bottom">
        <span class="add">添加打印机</span>
        <span class="save">保存修改</span>
    </div>
</div>
</template>

<script>
import request from "./../utils/request";
import {
    apiUrl
} from "@util/index";
import qs from "qs";
export default {
    data() {
        return {
            result: ["1", "1"],
        };
    },
    methods: {},
    mounted() {
        // request({
        //   method: "POST",
        //   url: apiUrl,
        //   headers: {
        //     "Content-Type": "application/x-www-form-urlencoded",
        //   },
        //   data: {
        //     action: "User_getShopInfoById",
        //     sid: 1,
        //     pid:2
        //   },
        //   transformRequest: [
        //     function (data) {
        //       return qs.stringify(data);
        //     },
        //   ],
        // }).then((res) => {
        //   let data = res.data;
        //   console.error(data);
        // });
        request({
            method: "POST",
            url: apiUrl,
            headers: {
                "Content-Type": "application/x-www-form-urlencoded",
            },
            data: {
                action: "Printer_getInfoListAll",
                sid: 20590783,
                pid: 2,
            },
            transformRequest: [
                function (data) {
                    return qs.stringify(data);
                },
            ],
        }).then((res) => {
            let data = res.data;
            console.error(data);
        });
    },
};
</script>

<style lang="less">
@import "index.less";
</style>
